package com.wlcj.www.model.data;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;
import com.wlcj.util.SqlUtil;

public class Data extends Model<Data> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2744800396935347847L;
	
	public static final Data dao = new Data();
	
	public List<Data> getDataList(String type) {
		String sql = "select * from `wd_new_data` where type = ? order by volume desc";
		return find(sql, type);
	}
	
	public List<Data> getDataList(String type, String orderby) {
		System.err.println(type);
		System.err.println(orderby);
		String sql = "select * from `wd_new_data` where type = ? order by "+orderby;
		return find(sql, type);
	}

	public List<Data> getDataList(String mintime,String maxtime,String orderby) {
		return find(SqlUtil.sql("data.calculateList"),maxtime,mintime,maxtime,orderby);
	}
	
	public List<Data> getMaxDate(){
		return find(SqlUtil.sql("data.getMaxdate"));
	}
}
